using System;
using System.Collections.Generic;
using System.Text;
using ACS.Compiler.Tables;
using ACS.Compiler.Tree.Interfaces;

namespace ACS.Compiler.Tree.Impl
{
    public abstract class Statement :TreeBase, ICodeItem
    {
        public enum Statements {Call, Assign, If, While, Return, Block}

        public abstract Statements StatementType
        {
            get;
        }

        public override TreeTags Tag
        {
            get 
            {
                switch (StatementType)
                {
                    case Statements.Call:
                        return TreeTags.Call;
                    case Statements.Assign:
                        return TreeTags.Assign;
                    case Statements.If:
                        return TreeTags.If;
                    case Statements.While:
                        return TreeTags.While;
                    case Statements.Return:
                        return TreeTags.Return;
                    case Statements.Block:
                        return TreeTags.Block;
                }
                throw new Exception("Wrong statement tag");
            }
        }

        public abstract void Resolve(string ns, DataTable localData);

        public abstract void Format();
    }
}
